package com.tree.backend.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 优化结果记录表
 * </p>
 *
 * @author tree
 * @since 2025-10-24
 */
@Getter
@Setter
@ToString
@TableName("optimization_result")
public class OptimizationResult implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 结果ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 任务ID
     */
    private Integer taskId;

    /**
     * 优化前指标(JSON格式)
     */
    private String beforeMetrics;

    /**
     * 优化后指标(JSON格式)
     */
    private String afterMetrics;

    /**
     * 改善率(%)
     */
    private BigDecimal improvementRate;

    /**
     * 优化详情
     */
    private String optimizationDetails;

    /**
     * 结果状态(1-成功 0-失败)
     */
    private Boolean resultStatus;

    /**
     * 执行时长(秒)
     */
    private Integer executeDuration;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;
}
